package com.haust.itemcategory.com.sxt.controller;

import com.haust.commons.pojo.HaustResult;
import com.haust.itemcategory.com.sxt.service.ItemCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
public class ItemCategoryController {
    @Autowired
    private ItemCategoryService itemCategoryService;

    /**
     * 根据父商品非类主键，查询子商品分类集合
     * @param parentId
     * @return
     */
    @PostMapping("/backend/itemCategory/selectItemCategoryByParentId")
    public HaustResult selectItemCategoryByParentId(@RequestParam(value = "id",defaultValue = "0") Long parentId){
        return itemCategoryService.selectItemCategoryByParentId(parentId);
    }
}
